<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.2"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Hardware Abstraction Layer (HAL)</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><a href="http://www.cypress.com/"><img alt="Logo" src="logo.png"/></a></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Hardware Abstraction Layer (HAL)</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.2 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('group__group__hal__timer.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#groups">API Reference</a> &#124;
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#define-members">Macros</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle"><div class="title">Timer (Timer/Counter)<div class="ingroups"><a class="el" href="group__group__hal.html">HAL Drivers</a></div></div></div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">General Description</h2>
<p >High level interface for interacting with the Timer/Counter hardware resource. </p>
<p >The timer block is commonly used to measure the time of occurrence of an event, to measure the time difference between two events or perform an action after a specified period of time. The driver also allows the user to invoke a callback function when a particular event occurs.</p>
<p >Some use case scenarios of timer -</p>
<ul>
<li>Creating a periodic interrupt for executing periodic tasks</li>
<li>Measuring time between two events</li>
<li>Triggering other system resources after a certain number of events</li>
<li>Capturing time stamps when events occur</li>
</ul>
<h1><a class="anchor" id="subsection_timer_features"></a>
Features</h1>
<ul>
<li>Runtime configurable parameters like period and compare value - <a class="el" href="group__group__hal__timer.html#structcyhal__timer__cfg__t">cyhal_timer_cfg_t</a></li>
<li>Configurable counting direction - <a class="el" href="group__group__hal__timer.html#gaeb28a1b2d8914e9ad63bb0a68c321ff6">cyhal_timer_direction_t</a></li>
<li>Interrupt on various events - <a class="el" href="group__group__hal__timer.html#ga39a171d6680fe30685a6e27a333db8e9">cyhal_timer_event_t</a></li>
<li>Continuous or One Shot run modes</li>
</ul>
<h1><a class="anchor" id="subsection_timer_quickstart"></a>
Quick Start</h1>
<p ><a class="el" href="group__group__hal__timer.html#gaa8ca8e199bc9848f8729ff78953bb0fa">cyhal_timer_init</a> can be used for timer initialization by providing the timer object - <a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__timer__t">cyhal_timer_t</a>, and shared clock source - <b> clk </b> (optional). The timer parameters needs to be populated in <a class="el" href="group__group__hal__timer.html#structcyhal__timer__cfg__t">cyhal_timer_cfg_t</a> structure. The timer then needs to be configured by using the <a class="el" href="group__group__hal__timer.html#ga03e9a7839ffd4e8cad90f97fab176813">cyhal_timer_configure</a> function.</p>
<dl class="section note"><dt>Note</dt><dd>A default frequency is set when an existing clock divider - <b> clk </b> is not provided to <a class="el" href="group__group__hal__timer.html#gaa8ca8e199bc9848f8729ff78953bb0fa">cyhal_timer_init</a> which is defined by the macro - <a class="el" href="group__group__hal__timer.html#ga28d85cf945883c0e74a533a4ddd7b122">CYHAL_TIMER_DEFAULT_FREQ</a>.</dd></dl>
<dl class="section warning"><dt>Warning</dt><dd>Currently there is no support for pin connections to Timer using this driver. So, the <b> pin </b> should be assigned as <a class="el" href="group__group__hal__impl__pin__package__xmc7200__320__bga.html#ggad38839a2406ac562d708d7639fbff225a3dbd1016ea99d087d747530418b89a01">NC</a> while using the <a class="el" href="group__group__hal__timer.html#gaa8ca8e199bc9848f8729ff78953bb0fa">cyhal_timer_init</a> to initialize the timer.</dd></dl>
<p>See <a class="el" href="group__group__hal__timer.html#subsection_timer_snippet_1">Snippet 1: Measuring time of an operation</a>.</p>
<h1><a class="anchor" id="subsection_timer_sample_snippets"></a>
Code Snippets</h1>
<h2><a class="anchor" id="subsection_timer_snippet_1"></a>
Snippet 1: Measuring time of an operation</h2>
<p >The following snippet initializes a Timer and measures the time between two events. The <b>clk</b> need not be provided, in which case a clock resource is assigned. </p><div class="fragment"><div class="line">    <a class="code hl_typedef" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> rslt;</div>
<div class="line">    uint32_t  read_val;</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Timer object used</span></div>
<div class="line">    <a class="code hl_struct" href="group__group__hal__impl__hw__types.html#structcyhal__timer__t">cyhal_timer_t</a> timer_obj;</div>
<div class="line"> </div>
<div class="line">    <span class="keyword">const</span> <a class="code hl_struct" href="group__group__hal__timer.html#structcyhal__timer__cfg__t">cyhal_timer_cfg_t</a> timer_cfg =</div>
<div class="line">    {</div>
<div class="line">        .<a class="code hl_variable" href="group__group__hal__timer.html#a2fb1a2da36b09c9a1febca770afe3190">compare_value</a> = 0,                  <span class="comment">// Timer compare value, not used</span></div>
<div class="line">        .period        = 20000,              <span class="comment">// Timer period set to a large enough value</span></div>
<div class="line">                                             <span class="comment">//   compared to event being measured</span></div>
<div class="line">        .direction     = <a class="code hl_enumvalue" href="group__group__hal__timer.html#ggaeb28a1b2d8914e9ad63bb0a68c321ff6a1f50f295ead6dbdb36edefc03a183810">CYHAL_TIMER_DIR_UP</a>, <span class="comment">// Timer counts up</span></div>
<div class="line">        .is_compare    = <span class="keyword">false</span>,              <span class="comment">// Don&#39;t use compare mode</span></div>
<div class="line">        .is_continuous = <span class="keyword">false</span>,              <span class="comment">// Do not run timer indefinitely</span></div>
<div class="line">        .value         = 0                   <span class="comment">// Initial value of counter</span></div>
<div class="line">    };</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Initialize the timer object. Does not use pin output (&#39;pin&#39; is NC) and does not use a</span></div>
<div class="line">    <span class="comment">// pre-configured clock source (&#39;clk&#39; is NULL).</span></div>
<div class="line">    rslt = <a class="code hl_function" href="group__group__hal__timer.html#gaa8ca8e199bc9848f8729ff78953bb0fa">cyhal_timer_init</a>(&amp;timer_obj, <a class="code hl_enumvalue" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#gga707195ce0627016bf371643bdd9caa51a3dbd1016ea99d087d747530418b89a01">NC</a>, NULL);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Apply timer configuration such as period, count direction, run mode, etc.</span></div>
<div class="line">    <a class="code hl_function" href="group__group__hal__timer.html#ga03e9a7839ffd4e8cad90f97fab176813">cyhal_timer_configure</a>(&amp;timer_obj, &amp;timer_cfg);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Set the frequency of timer to 10000 counts in a second or 10000 Hz</span></div>
<div class="line">    <a class="code hl_function" href="group__group__hal__timer.html#ga38ed4c91e655b8b4f5e446c63327ffe5">cyhal_timer_set_frequency</a>(&amp;timer_obj, 10000);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Start the timer with the configured settings</span></div>
<div class="line">    <a class="code hl_function" href="group__group__hal__timer.html#gaff09b3ffee75893da00d0a7dae2d9cb2">cyhal_timer_start</a>(&amp;timer_obj);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Delay Function simulates the time between two events</span></div>
<div class="line">    <a class="code hl_function" href="group__group__hal__system.html#ga5f450769c1207d98134a9ced39adfdda">cyhal_system_delay_ms</a>(500);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Read the current timer value, which should be close to the amount of delay in ms * 10 (5000)</span></div>
<div class="line">    read_val = <a class="code hl_function" href="group__group__hal__timer.html#ga0be5bf53c214ffcb3c4e962e71af1e6d">cyhal_timer_read</a>(&amp;timer_obj);</div>
<div class="ttc" id="agroup__group__hal__impl__hw__types_html_structcyhal__timer__t"><div class="ttname"><a href="group__group__hal__impl__hw__types.html#structcyhal__timer__t">cyhal_timer_t</a></div><div class="ttdoc">Timer object.</div><div class="ttdef"><b>Definition:</b> cyhal_hw_types.h:1473</div></div>
<div class="ttc" id="agroup__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble_html_gga707195ce0627016bf371643bdd9caa51a3dbd1016ea99d087d747530418b89a01"><div class="ttname"><a href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#gga707195ce0627016bf371643bdd9caa51a3dbd1016ea99d087d747530418b89a01">NC</a></div><div class="ttdeci">@ NC</div><div class="ttdoc">No Connect/Invalid Pin.</div><div class="ttdef"><b>Definition:</b> cyhal_psoc6_01_104_m_csp_ble.h:53</div></div>
<div class="ttc" id="agroup__group__hal__system_html_ga5f450769c1207d98134a9ced39adfdda"><div class="ttname"><a href="group__group__hal__system.html#ga5f450769c1207d98134a9ced39adfdda">cyhal_system_delay_ms</a></div><div class="ttdeci">cy_rslt_t cyhal_system_delay_ms(uint32_t milliseconds)</div><div class="ttdoc">Requests that the current operation delays for at least the specified length of time.</div></div>
<div class="ttc" id="agroup__group__hal__timer_html_a2fb1a2da36b09c9a1febca770afe3190"><div class="ttname"><a href="group__group__hal__timer.html#a2fb1a2da36b09c9a1febca770afe3190">cyhal_timer_cfg_t::compare_value</a></div><div class="ttdeci">uint32_t compare_value</div><div class="ttdoc">Timer/counter comparison value.</div><div class="ttdef"><b>Definition:</b> cyhal_timer.h:178</div></div>
<div class="ttc" id="agroup__group__hal__timer_html_ga03e9a7839ffd4e8cad90f97fab176813"><div class="ttname"><a href="group__group__hal__timer.html#ga03e9a7839ffd4e8cad90f97fab176813">cyhal_timer_configure</a></div><div class="ttdeci">cy_rslt_t cyhal_timer_configure(cyhal_timer_t *obj, const cyhal_timer_cfg_t *cfg)</div><div class="ttdoc">Updates the configuration and counter value of the timer/counter object.</div></div>
<div class="ttc" id="agroup__group__hal__timer_html_ga0be5bf53c214ffcb3c4e962e71af1e6d"><div class="ttname"><a href="group__group__hal__timer.html#ga0be5bf53c214ffcb3c4e962e71af1e6d">cyhal_timer_read</a></div><div class="ttdeci">uint32_t cyhal_timer_read(const cyhal_timer_t *obj)</div><div class="ttdoc">Reads the current value from the timer/counter   See Snippet 1: Measuring time of an operation.</div></div>
<div class="ttc" id="agroup__group__hal__timer_html_ga38ed4c91e655b8b4f5e446c63327ffe5"><div class="ttname"><a href="group__group__hal__timer.html#ga38ed4c91e655b8b4f5e446c63327ffe5">cyhal_timer_set_frequency</a></div><div class="ttdeci">cy_rslt_t cyhal_timer_set_frequency(cyhal_timer_t *obj, uint32_t hz)</div><div class="ttdoc">Configures the timer frequency.</div></div>
<div class="ttc" id="agroup__group__hal__timer_html_gaa8ca8e199bc9848f8729ff78953bb0fa"><div class="ttname"><a href="group__group__hal__timer.html#gaa8ca8e199bc9848f8729ff78953bb0fa">cyhal_timer_init</a></div><div class="ttdeci">cy_rslt_t cyhal_timer_init(cyhal_timer_t *obj, cyhal_gpio_t pin, const cyhal_clock_t *clk)</div><div class="ttdoc">Initialize the timer/counter peripheral and configure the pin.</div></div>
<div class="ttc" id="agroup__group__hal__timer_html_gaff09b3ffee75893da00d0a7dae2d9cb2"><div class="ttname"><a href="group__group__hal__timer.html#gaff09b3ffee75893da00d0a7dae2d9cb2">cyhal_timer_start</a></div><div class="ttdeci">cy_rslt_t cyhal_timer_start(cyhal_timer_t *obj)</div><div class="ttdoc">Starts the timer/counter with the pre-set configuration from cyhal_timer_configure.</div></div>
<div class="ttc" id="agroup__group__hal__timer_html_ggaeb28a1b2d8914e9ad63bb0a68c321ff6a1f50f295ead6dbdb36edefc03a183810"><div class="ttname"><a href="group__group__hal__timer.html#ggaeb28a1b2d8914e9ad63bb0a68c321ff6a1f50f295ead6dbdb36edefc03a183810">CYHAL_TIMER_DIR_UP</a></div><div class="ttdeci">@ CYHAL_TIMER_DIR_UP</div><div class="ttdoc">Counts up.</div><div class="ttdef"><b>Definition:</b> cyhal_timer.h:130</div></div>
<div class="ttc" id="agroup__group__hal__timer_html_structcyhal__timer__cfg__t"><div class="ttname"><a href="group__group__hal__timer.html#structcyhal__timer__cfg__t">cyhal_timer_cfg_t</a></div><div class="ttdoc">Describes the current configuration of a timer/counter.</div><div class="ttdef"><b>Definition:</b> cyhal_timer.h:168</div></div>
<div class="ttc" id="agroup__group__result_html_gaca79700fcc701534ce61778a9bcf57d1"><div class="ttname"><a href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a></div><div class="ttdeci">uint32_t cy_rslt_t</div><div class="ttdoc">Provides the result of an operation as a structured bitfield.</div><div class="ttdef"><b>Definition:</b> cy_result.h:438</div></div>
</div><!-- fragment --><h2><a class="anchor" id="subsection_timer_snippet_2"></a>
Snippet 2: Handling an event in a callback function</h2>
<p >The following snippet initializes a Timer and triggers an event after every one second. The <b>clk</b> need not be provided (NULL), in which case a clock resource is assigned. </p><div class="fragment"><div class="line"><span class="keywordtype">bool</span> timer_interrupt_flag = <span class="keyword">false</span>;</div>
<div class="line"> </div>
<div class="line"><span class="comment">// Timer object used</span></div>
<div class="line"><a class="code hl_struct" href="group__group__hal__impl__hw__types.html#structcyhal__timer__t">cyhal_timer_t</a> timer_obj;</div>
<div class="line"> </div>
<div class="line"><span class="keyword">static</span> <span class="keywordtype">void</span> isr_timer(<span class="keywordtype">void</span>* callback_arg, <a class="code hl_enumeration" href="group__group__hal__timer.html#ga39a171d6680fe30685a6e27a333db8e9">cyhal_timer_event_t</a> event)</div>
<div class="line">{</div>
<div class="line">    (void)callback_arg;</div>
<div class="line">    (void)event;</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Set the interrupt flag and process it from the application</span></div>
<div class="line">    timer_interrupt_flag = <span class="keyword">true</span>;</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line"><a class="code hl_typedef" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> snippet_cyhal_timer_event_interrupt()</div>
<div class="line">{</div>
<div class="line">    <a class="code hl_typedef" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> rslt;</div>
<div class="line"> </div>
<div class="line">    <span class="keyword">const</span> <a class="code hl_struct" href="group__group__hal__timer.html#structcyhal__timer__cfg__t">cyhal_timer_cfg_t</a> timer_cfg =</div>
<div class="line">    {</div>
<div class="line">        .<a class="code hl_variable" href="group__group__hal__timer.html#a2fb1a2da36b09c9a1febca770afe3190">compare_value</a> = 0,                  <span class="comment">// Timer compare value, not used</span></div>
<div class="line">        .period        = 9999,               <span class="comment">// Defines the timer period</span></div>
<div class="line">        .direction     = <a class="code hl_enumvalue" href="group__group__hal__timer.html#ggaeb28a1b2d8914e9ad63bb0a68c321ff6a1f50f295ead6dbdb36edefc03a183810">CYHAL_TIMER_DIR_UP</a>, <span class="comment">// Timer counts up</span></div>
<div class="line">        .is_compare    = <span class="keyword">false</span>,              <span class="comment">// Don&#39;t use compare mode</span></div>
<div class="line">        .is_continuous = <span class="keyword">true</span>,               <span class="comment">// Run the timer indefinitely</span></div>
<div class="line">        .value         = 0                   <span class="comment">// Initial value of counter</span></div>
<div class="line">    };</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Initialize the timer object. Does not use pin output (&#39;pin&#39; is NC) and does not use a</span></div>
<div class="line">    <span class="comment">// pre-configured clock source (&#39;clk&#39; is NULL).</span></div>
<div class="line">    rslt = <a class="code hl_function" href="group__group__hal__timer.html#gaa8ca8e199bc9848f8729ff78953bb0fa">cyhal_timer_init</a>(&amp;timer_obj, <a class="code hl_enumvalue" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#gga707195ce0627016bf371643bdd9caa51a3dbd1016ea99d087d747530418b89a01">NC</a>, NULL);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Apply timer configuration such as period, count direction, run mode, etc.</span></div>
<div class="line">    <span class="keywordflow">if</span> (<a class="code hl_define" href="group__group__result.html#gaf58fac450d9fff4472f03ad68f6e546e">CY_RSLT_SUCCESS</a> == rslt)</div>
<div class="line">    {</div>
<div class="line">        rslt = <a class="code hl_function" href="group__group__hal__timer.html#ga03e9a7839ffd4e8cad90f97fab176813">cyhal_timer_configure</a>(&amp;timer_obj, &amp;timer_cfg);</div>
<div class="line">    }</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Set the frequency of timer to 10000 Hz</span></div>
<div class="line">    <span class="keywordflow">if</span> (<a class="code hl_define" href="group__group__result.html#gaf58fac450d9fff4472f03ad68f6e546e">CY_RSLT_SUCCESS</a> == rslt)</div>
<div class="line">    {</div>
<div class="line">        rslt = <a class="code hl_function" href="group__group__hal__timer.html#ga38ed4c91e655b8b4f5e446c63327ffe5">cyhal_timer_set_frequency</a>(&amp;timer_obj, 10000);</div>
<div class="line">    }</div>
<div class="line"> </div>
<div class="line">    <span class="keywordflow">if</span> (<a class="code hl_define" href="group__group__result.html#gaf58fac450d9fff4472f03ad68f6e546e">CY_RSLT_SUCCESS</a> == rslt)</div>
<div class="line">    {</div>
<div class="line">        <span class="comment">// Assign the ISR to execute on timer interrupt</span></div>
<div class="line">        <a class="code hl_function" href="group__group__hal__timer.html#ga928ffe0a3a1549c94752db7c68306424">cyhal_timer_register_callback</a>(&amp;timer_obj, isr_timer, NULL);</div>
<div class="line"> </div>
<div class="line">        <span class="comment">// Set the event on which timer interrupt occurs and enable it</span></div>
<div class="line">        <a class="code hl_function" href="group__group__hal__timer.html#ga4b97fe48330e9b8034ab7c2f56078002">cyhal_timer_enable_event</a>(&amp;timer_obj, <a class="code hl_enumvalue" href="group__group__hal__timer.html#gga39a171d6680fe30685a6e27a333db8e9a51b932b9e3e80d5dd7e98b75e7e8228e">CYHAL_TIMER_IRQ_TERMINAL_COUNT</a>, 3, <span class="keyword">true</span>);</div>
<div class="line"> </div>
<div class="line">        <span class="comment">// Start the timer with the configured settings</span></div>
<div class="line">        rslt = <a class="code hl_function" href="group__group__hal__timer.html#gaff09b3ffee75893da00d0a7dae2d9cb2">cyhal_timer_start</a>(&amp;timer_obj);</div>
<div class="line">    }</div>
<div class="line"> </div>
<div class="line">    <span class="keywordflow">return</span> rslt;</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="ttc" id="agroup__group__hal__timer_html_ga39a171d6680fe30685a6e27a333db8e9"><div class="ttname"><a href="group__group__hal__timer.html#ga39a171d6680fe30685a6e27a333db8e9">cyhal_timer_event_t</a></div><div class="ttdeci">cyhal_timer_event_t</div><div class="ttdoc">Timer/counter interrupt triggers.</div><div class="ttdef"><b>Definition:</b> cyhal_timer.h:136</div></div>
<div class="ttc" id="agroup__group__hal__timer_html_ga4b97fe48330e9b8034ab7c2f56078002"><div class="ttname"><a href="group__group__hal__timer.html#ga4b97fe48330e9b8034ab7c2f56078002">cyhal_timer_enable_event</a></div><div class="ttdeci">void cyhal_timer_enable_event(cyhal_timer_t *obj, cyhal_timer_event_t event, uint8_t intr_priority, bool enable)</div><div class="ttdoc">Configure timer/counter event enablement</div></div>
<div class="ttc" id="agroup__group__hal__timer_html_ga928ffe0a3a1549c94752db7c68306424"><div class="ttname"><a href="group__group__hal__timer.html#ga928ffe0a3a1549c94752db7c68306424">cyhal_timer_register_callback</a></div><div class="ttdeci">void cyhal_timer_register_callback(cyhal_timer_t *obj, cyhal_timer_event_callback_t callback, void *callback_arg)</div><div class="ttdoc">Register a timer/counter callback handler</div></div>
<div class="ttc" id="agroup__group__hal__timer_html_gga39a171d6680fe30685a6e27a333db8e9a51b932b9e3e80d5dd7e98b75e7e8228e"><div class="ttname"><a href="group__group__hal__timer.html#gga39a171d6680fe30685a6e27a333db8e9a51b932b9e3e80d5dd7e98b75e7e8228e">CYHAL_TIMER_IRQ_TERMINAL_COUNT</a></div><div class="ttdeci">@ CYHAL_TIMER_IRQ_TERMINAL_COUNT</div><div class="ttdoc">Interrupt when terminal count is reached.</div><div class="ttdef"><b>Definition:</b> cyhal_timer.h:138</div></div>
<div class="ttc" id="agroup__group__result_html_gaf58fac450d9fff4472f03ad68f6e546e"><div class="ttname"><a href="group__group__result.html#gaf58fac450d9fff4472f03ad68f6e546e">CY_RSLT_SUCCESS</a></div><div class="ttdeci">#define CY_RSLT_SUCCESS</div><div class="ttdoc">cy_rslt_t return value indicating success</div><div class="ttdef"><b>Definition:</b> cy_result.h:465</div></div>
</div><!-- fragment --> <table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="groups" name="groups"></a>
API Reference</h2></td></tr>
<tr class="memitem:group__group__hal__results__timer"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__results__timer.html">Timer HAL Results</a></td></tr>
<tr class="memdesc:group__group__hal__results__timer"><td class="mdescLeft">&#160;</td><td class="mdescRight">Timer specific return codes. <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="nested-classes" name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:structcyhal__timer__cfg__t"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__timer.html#structcyhal__timer__cfg__t">cyhal_timer_cfg_t</a></td></tr>
<tr class="memdesc:structcyhal__timer__cfg__t"><td class="mdescLeft">&#160;</td><td class="mdescRight">Describes the current configuration of a timer/counter.  <a href="group__group__hal__timer.html#structcyhal__timer__cfg__t">More...</a><br /></td></tr>
<tr class="separator:structcyhal__timer__cfg__t"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="define-members" name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:ga28d85cf945883c0e74a533a4ddd7b122"><td class="memItemLeft" align="right" valign="top"><a id="ga28d85cf945883c0e74a533a4ddd7b122" name="ga28d85cf945883c0e74a533a4ddd7b122"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>CYHAL_TIMER_DEFAULT_FREQ</b>&#160;&#160;&#160;(1000000u)</td></tr>
<tr class="memdesc:ga28d85cf945883c0e74a533a4ddd7b122"><td class="mdescLeft">&#160;</td><td class="mdescRight">Default timer frequency, used when an existing clock divider is not provided to <a class="el" href="group__group__hal__timer.html#gaa8ca8e199bc9848f8729ff78953bb0fa">cyhal_timer_init()</a> <br /></td></tr>
<tr class="separator:ga28d85cf945883c0e74a533a4ddd7b122"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="typedef-members" name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:gae239f85fa523177aeed212846e491206"><td class="memItemLeft" align="right" valign="top"><a id="gae239f85fa523177aeed212846e491206" name="gae239f85fa523177aeed212846e491206"></a>
typedef void(*&#160;</td><td class="memItemRight" valign="bottom"><b>cyhal_timer_event_callback_t</b>) (void *callback_arg, <a class="el" href="group__group__hal__timer.html#ga39a171d6680fe30685a6e27a333db8e9">cyhal_timer_event_t</a> event)</td></tr>
<tr class="memdesc:gae239f85fa523177aeed212846e491206"><td class="mdescLeft">&#160;</td><td class="mdescRight">Handler for timer events. <br /></td></tr>
<tr class="separator:gae239f85fa523177aeed212846e491206"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="enum-members" name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:gaeb28a1b2d8914e9ad63bb0a68c321ff6"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__timer.html#gaeb28a1b2d8914e9ad63bb0a68c321ff6">cyhal_timer_direction_t</a> { <br />
&#160;&#160;<a class="el" href="group__group__hal__timer.html#ggaeb28a1b2d8914e9ad63bb0a68c321ff6a1f50f295ead6dbdb36edefc03a183810">CYHAL_TIMER_DIR_UP</a>
, <br />
&#160;&#160;<a class="el" href="group__group__hal__timer.html#ggaeb28a1b2d8914e9ad63bb0a68c321ff6a1595c7343fcdb73d4745f5062d969905">CYHAL_TIMER_DIR_DOWN</a>
, <br />
&#160;&#160;<a class="el" href="group__group__hal__timer.html#ggaeb28a1b2d8914e9ad63bb0a68c321ff6af3b8efb5f43123961d8631f74db7ea43">CYHAL_TIMER_DIR_UP_DOWN</a>
<br />
 }</td></tr>
<tr class="memdesc:gaeb28a1b2d8914e9ad63bb0a68c321ff6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Timer directions.  <a href="group__group__hal__timer.html#gaeb28a1b2d8914e9ad63bb0a68c321ff6">More...</a><br /></td></tr>
<tr class="separator:gaeb28a1b2d8914e9ad63bb0a68c321ff6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga39a171d6680fe30685a6e27a333db8e9"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__timer.html#ga39a171d6680fe30685a6e27a333db8e9">cyhal_timer_event_t</a> { <br />
&#160;&#160;<a class="el" href="group__group__hal__timer.html#gga39a171d6680fe30685a6e27a333db8e9ad9b21c35e61b69c316bee693b8fcb0d6">CYHAL_TIMER_IRQ_NONE</a> = 0
, <br />
&#160;&#160;<a class="el" href="group__group__hal__timer.html#gga39a171d6680fe30685a6e27a333db8e9a51b932b9e3e80d5dd7e98b75e7e8228e">CYHAL_TIMER_IRQ_TERMINAL_COUNT</a> = 1 &lt;&lt; 0
, <br />
&#160;&#160;<a class="el" href="group__group__hal__timer.html#gga39a171d6680fe30685a6e27a333db8e9a90cf556247ca96952af696c0a4d53e15">CYHAL_TIMER_IRQ_CAPTURE_COMPARE</a> = 1 &lt;&lt; 1
, <br />
&#160;&#160;<a class="el" href="group__group__hal__timer.html#gga39a171d6680fe30685a6e27a333db8e9a3b6afa3bcff5af8b040f479eda3aaf35">CYHAL_TIMER_IRQ_ALL</a> = (1 &lt;&lt; 2) - 1
<br />
 }</td></tr>
<tr class="memdesc:ga39a171d6680fe30685a6e27a333db8e9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Timer/counter interrupt triggers.  <a href="group__group__hal__timer.html#ga39a171d6680fe30685a6e27a333db8e9">More...</a><br /></td></tr>
<tr class="separator:ga39a171d6680fe30685a6e27a333db8e9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gadb5da20c0e7111025f4091339dd36fc4"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__timer.html#gadb5da20c0e7111025f4091339dd36fc4">cyhal_timer_input_t</a> { <br />
&#160;&#160;<a class="el" href="group__group__hal__timer.html#ggadb5da20c0e7111025f4091339dd36fc4a39572bdfb86d6dadc6d9d08480590ec3">CYHAL_TIMER_INPUT_START</a>
, <br />
&#160;&#160;<a class="el" href="group__group__hal__timer.html#ggadb5da20c0e7111025f4091339dd36fc4a7d545c6eded78a0ed888498ab4c5fe61">CYHAL_TIMER_INPUT_STOP</a>
, <br />
&#160;&#160;<a class="el" href="group__group__hal__timer.html#ggadb5da20c0e7111025f4091339dd36fc4ac402b6500fe2fcc1af7438b007cdf3fd">CYHAL_TIMER_INPUT_RELOAD</a>
, <br />
&#160;&#160;<a class="el" href="group__group__hal__timer.html#ggadb5da20c0e7111025f4091339dd36fc4a6233db4685faff6dda6280f0cd52eccd">CYHAL_TIMER_INPUT_COUNT</a>
, <br />
&#160;&#160;<a class="el" href="group__group__hal__timer.html#ggadb5da20c0e7111025f4091339dd36fc4a5ff68c52fe77347327cf5bf47d070ced">CYHAL_TIMER_INPUT_CAPTURE</a>
<br />
 }</td></tr>
<tr class="memdesc:gadb5da20c0e7111025f4091339dd36fc4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Timer/counter input signal.  <a href="group__group__hal__timer.html#gadb5da20c0e7111025f4091339dd36fc4">More...</a><br /></td></tr>
<tr class="separator:gadb5da20c0e7111025f4091339dd36fc4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3b82fcbb7e540b55f1923f0cc4c77c30"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__timer.html#ga3b82fcbb7e540b55f1923f0cc4c77c30">cyhal_timer_output_t</a> { <br />
&#160;&#160;<a class="el" href="group__group__hal__timer.html#gga3b82fcbb7e540b55f1923f0cc4c77c30a46034ce48203bb1afe267c91a0f73e6e">CYHAL_TIMER_OUTPUT_OVERFLOW</a>
, <br />
&#160;&#160;<a class="el" href="group__group__hal__timer.html#gga3b82fcbb7e540b55f1923f0cc4c77c30ad83649c73f9d095d18155c034a228b45">CYHAL_TIMER_OUTPUT_UNDERFLOW</a>
, <br />
&#160;&#160;<a class="el" href="group__group__hal__timer.html#gga3b82fcbb7e540b55f1923f0cc4c77c30a50d874faf93ea7d2ad764b7f92d9c777">CYHAL_TIMER_OUTPUT_COMPARE_MATCH</a>
, <br />
&#160;&#160;<a class="el" href="group__group__hal__timer.html#gga3b82fcbb7e540b55f1923f0cc4c77c30aa9b363110f2ed6190d1775dbe7f9c673">CYHAL_TIMER_OUTPUT_TERMINAL_COUNT</a>
<br />
 }</td></tr>
<tr class="memdesc:ga3b82fcbb7e540b55f1923f0cc4c77c30"><td class="mdescLeft">&#160;</td><td class="mdescRight">Timer/counter output signal.  <a href="group__group__hal__timer.html#ga3b82fcbb7e540b55f1923f0cc4c77c30">More...</a><br /></td></tr>
<tr class="separator:ga3b82fcbb7e540b55f1923f0cc4c77c30"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gaa8ca8e199bc9848f8729ff78953bb0fa"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__timer.html#gaa8ca8e199bc9848f8729ff78953bb0fa">cyhal_timer_init</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__timer__t">cyhal_timer_t</a> *obj, <a class="el" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#ga707195ce0627016bf371643bdd9caa51">cyhal_gpio_t</a> pin, const <a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__clock__t">cyhal_clock_t</a> *clk)</td></tr>
<tr class="memdesc:gaa8ca8e199bc9848f8729ff78953bb0fa"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize the timer/counter peripheral and configure the pin.  <a href="group__group__hal__timer.html#gaa8ca8e199bc9848f8729ff78953bb0fa">More...</a><br /></td></tr>
<tr class="separator:gaa8ca8e199bc9848f8729ff78953bb0fa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0ecbd9618bb7cedb7f4b77525e274b09"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__timer.html#ga0ecbd9618bb7cedb7f4b77525e274b09">cyhal_timer_init_cfg</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__timer__t">cyhal_timer_t</a> *obj, const <a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__timer__configurator__t">cyhal_timer_configurator_t</a> *cfg)</td></tr>
<tr class="memdesc:ga0ecbd9618bb7cedb7f4b77525e274b09"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize the Timer peripheral using a configurator generated configuration struct.  <a href="group__group__hal__timer.html#ga0ecbd9618bb7cedb7f4b77525e274b09">More...</a><br /></td></tr>
<tr class="separator:ga0ecbd9618bb7cedb7f4b77525e274b09"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga94944664f47b8ff7c093719116b35cdc"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__timer.html#ga94944664f47b8ff7c093719116b35cdc">cyhal_timer_free</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__timer__t">cyhal_timer_t</a> *obj)</td></tr>
<tr class="memdesc:ga94944664f47b8ff7c093719116b35cdc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Deinitialize the timer/counter object.  <a href="group__group__hal__timer.html#ga94944664f47b8ff7c093719116b35cdc">More...</a><br /></td></tr>
<tr class="separator:ga94944664f47b8ff7c093719116b35cdc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga03e9a7839ffd4e8cad90f97fab176813"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__timer.html#ga03e9a7839ffd4e8cad90f97fab176813">cyhal_timer_configure</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__timer__t">cyhal_timer_t</a> *obj, const <a class="el" href="group__group__hal__timer.html#structcyhal__timer__cfg__t">cyhal_timer_cfg_t</a> *cfg)</td></tr>
<tr class="memdesc:ga03e9a7839ffd4e8cad90f97fab176813"><td class="mdescLeft">&#160;</td><td class="mdescRight">Updates the configuration and counter value of the timer/counter object.  <a href="group__group__hal__timer.html#ga03e9a7839ffd4e8cad90f97fab176813">More...</a><br /></td></tr>
<tr class="separator:ga03e9a7839ffd4e8cad90f97fab176813"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga38ed4c91e655b8b4f5e446c63327ffe5"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__timer.html#ga38ed4c91e655b8b4f5e446c63327ffe5">cyhal_timer_set_frequency</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__timer__t">cyhal_timer_t</a> *obj, uint32_t hz)</td></tr>
<tr class="memdesc:ga38ed4c91e655b8b4f5e446c63327ffe5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Configures the timer frequency.  <a href="group__group__hal__timer.html#ga38ed4c91e655b8b4f5e446c63327ffe5">More...</a><br /></td></tr>
<tr class="separator:ga38ed4c91e655b8b4f5e446c63327ffe5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaff09b3ffee75893da00d0a7dae2d9cb2"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__timer.html#gaff09b3ffee75893da00d0a7dae2d9cb2">cyhal_timer_start</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__timer__t">cyhal_timer_t</a> *obj)</td></tr>
<tr class="memdesc:gaff09b3ffee75893da00d0a7dae2d9cb2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Starts the timer/counter with the pre-set configuration from <a class="el" href="group__group__hal__timer.html#ga03e9a7839ffd4e8cad90f97fab176813">cyhal_timer_configure</a>.  <a href="group__group__hal__timer.html#gaff09b3ffee75893da00d0a7dae2d9cb2">More...</a><br /></td></tr>
<tr class="separator:gaff09b3ffee75893da00d0a7dae2d9cb2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8734bf8e55f7b51ef18a22e8d1ffb1e1"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__timer.html#ga8734bf8e55f7b51ef18a22e8d1ffb1e1">cyhal_timer_stop</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__timer__t">cyhal_timer_t</a> *obj)</td></tr>
<tr class="memdesc:ga8734bf8e55f7b51ef18a22e8d1ffb1e1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Stops the timer/counter.  <a href="group__group__hal__timer.html#ga8734bf8e55f7b51ef18a22e8d1ffb1e1">More...</a><br /></td></tr>
<tr class="separator:ga8734bf8e55f7b51ef18a22e8d1ffb1e1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga86878ca8f781c3ed1a50fbee9e37987f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__timer.html#ga86878ca8f781c3ed1a50fbee9e37987f">cyhal_timer_reset</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__timer__t">cyhal_timer_t</a> *obj)</td></tr>
<tr class="memdesc:ga86878ca8f781c3ed1a50fbee9e37987f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reset the timer/counter value to the default value set from <a class="el" href="group__group__hal__timer.html#ga03e9a7839ffd4e8cad90f97fab176813">cyhal_timer_configure</a>.  <a href="group__group__hal__timer.html#ga86878ca8f781c3ed1a50fbee9e37987f">More...</a><br /></td></tr>
<tr class="separator:ga86878ca8f781c3ed1a50fbee9e37987f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0be5bf53c214ffcb3c4e962e71af1e6d"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__timer.html#ga0be5bf53c214ffcb3c4e962e71af1e6d">cyhal_timer_read</a> (const <a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__timer__t">cyhal_timer_t</a> *obj)</td></tr>
<tr class="memdesc:ga0be5bf53c214ffcb3c4e962e71af1e6d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reads the current value from the timer/counter <br  />
 See <a class="el" href="group__group__hal__timer.html#subsection_timer_snippet_1">Snippet 1: Measuring time of an operation</a>.  <a href="group__group__hal__timer.html#ga0be5bf53c214ffcb3c4e962e71af1e6d">More...</a><br /></td></tr>
<tr class="separator:ga0be5bf53c214ffcb3c4e962e71af1e6d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga928ffe0a3a1549c94752db7c68306424"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__timer.html#ga928ffe0a3a1549c94752db7c68306424">cyhal_timer_register_callback</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__timer__t">cyhal_timer_t</a> *obj, <a class="el" href="group__group__hal__timer.html#gae239f85fa523177aeed212846e491206">cyhal_timer_event_callback_t</a> callback, void *callback_arg)</td></tr>
<tr class="memdesc:ga928ffe0a3a1549c94752db7c68306424"><td class="mdescLeft">&#160;</td><td class="mdescRight">Register a timer/counter callback handler<br  />
  <a href="group__group__hal__timer.html#ga928ffe0a3a1549c94752db7c68306424">More...</a><br /></td></tr>
<tr class="separator:ga928ffe0a3a1549c94752db7c68306424"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4b97fe48330e9b8034ab7c2f56078002"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__timer.html#ga4b97fe48330e9b8034ab7c2f56078002">cyhal_timer_enable_event</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__timer__t">cyhal_timer_t</a> *obj, <a class="el" href="group__group__hal__timer.html#ga39a171d6680fe30685a6e27a333db8e9">cyhal_timer_event_t</a> event, uint8_t intr_priority, bool enable)</td></tr>
<tr class="memdesc:ga4b97fe48330e9b8034ab7c2f56078002"><td class="mdescLeft">&#160;</td><td class="mdescRight">Configure timer/counter event enablement <br  />
  <a href="group__group__hal__timer.html#ga4b97fe48330e9b8034ab7c2f56078002">More...</a><br /></td></tr>
<tr class="separator:ga4b97fe48330e9b8034ab7c2f56078002"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5458a719692e938b056150351b287967"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__timer.html#ga5458a719692e938b056150351b287967">cyhal_timer_connect_digital</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__timer__t">cyhal_timer_t</a> *obj, <a class="el" href="group__group__hal__impl__triggers__psoc6__01.html#ga96236d1368f920d28af90262e8b57046">cyhal_source_t</a> source, <a class="el" href="group__group__hal__timer.html#gadb5da20c0e7111025f4091339dd36fc4">cyhal_timer_input_t</a> signal)</td></tr>
<tr class="memdesc:ga5458a719692e938b056150351b287967"><td class="mdescLeft">&#160;</td><td class="mdescRight">Connects a source signal and configures and enables a timer event to be triggered from that signal.  <a href="group__group__hal__timer.html#ga5458a719692e938b056150351b287967">More...</a><br /></td></tr>
<tr class="separator:ga5458a719692e938b056150351b287967"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaae442666b6e677210fb779f0d4e3a084"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__timer.html#gaae442666b6e677210fb779f0d4e3a084">cyhal_timer_connect_digital2</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__timer__t">cyhal_timer_t</a> *obj, <a class="el" href="group__group__hal__impl__triggers__psoc6__01.html#ga96236d1368f920d28af90262e8b57046">cyhal_source_t</a> source, <a class="el" href="group__group__hal__timer.html#gadb5da20c0e7111025f4091339dd36fc4">cyhal_timer_input_t</a> signal, <a class="el" href="group__group__hal__general__types.html#ga48a2f3a7a4210f50859fc68fa3db9391">cyhal_edge_type_t</a> edge_type)</td></tr>
<tr class="memdesc:gaae442666b6e677210fb779f0d4e3a084"><td class="mdescLeft">&#160;</td><td class="mdescRight">Connects a source signal and configures and enables a timer event to be triggered from that signal with a configurable edge type.  <a href="group__group__hal__timer.html#gaae442666b6e677210fb779f0d4e3a084">More...</a><br /></td></tr>
<tr class="separator:gaae442666b6e677210fb779f0d4e3a084"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0e7450df4a250d811d1ce60cb69285f8"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__timer.html#ga0e7450df4a250d811d1ce60cb69285f8">cyhal_timer_enable_output</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__timer__t">cyhal_timer_t</a> *obj, <a class="el" href="group__group__hal__timer.html#ga3b82fcbb7e540b55f1923f0cc4c77c30">cyhal_timer_output_t</a> signal, <a class="el" href="group__group__hal__impl__triggers__psoc6__01.html#ga96236d1368f920d28af90262e8b57046">cyhal_source_t</a> *source)</td></tr>
<tr class="memdesc:ga0e7450df4a250d811d1ce60cb69285f8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enables the specified output signal from a tcpwm that will be triggered when the corresponding event occurs.  <a href="group__group__hal__timer.html#ga0e7450df4a250d811d1ce60cb69285f8">More...</a><br /></td></tr>
<tr class="separator:ga0e7450df4a250d811d1ce60cb69285f8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4ca94d6326a64dfe56ad6616ee1524a1"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__timer.html#ga4ca94d6326a64dfe56ad6616ee1524a1">cyhal_timer_disconnect_digital</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__timer__t">cyhal_timer_t</a> *obj, <a class="el" href="group__group__hal__impl__triggers__psoc6__01.html#ga96236d1368f920d28af90262e8b57046">cyhal_source_t</a> source, <a class="el" href="group__group__hal__timer.html#gadb5da20c0e7111025f4091339dd36fc4">cyhal_timer_input_t</a> signal)</td></tr>
<tr class="memdesc:ga4ca94d6326a64dfe56ad6616ee1524a1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Disconnects a source signal and disables the timer event.  <a href="group__group__hal__timer.html#ga4ca94d6326a64dfe56ad6616ee1524a1">More...</a><br /></td></tr>
<tr class="separator:ga4ca94d6326a64dfe56ad6616ee1524a1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5f81dff94142cbb1e2fa28506bd00491"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__timer.html#ga5f81dff94142cbb1e2fa28506bd00491">cyhal_timer_disable_output</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__timer__t">cyhal_timer_t</a> *obj, <a class="el" href="group__group__hal__timer.html#ga3b82fcbb7e540b55f1923f0cc4c77c30">cyhal_timer_output_t</a> signal)</td></tr>
<tr class="memdesc:ga5f81dff94142cbb1e2fa28506bd00491"><td class="mdescLeft">&#160;</td><td class="mdescRight">Disables the specified output signal from a timer.  <a href="group__group__hal__timer.html#ga5f81dff94142cbb1e2fa28506bd00491">More...</a><br /></td></tr>
<tr class="separator:ga5f81dff94142cbb1e2fa28506bd00491"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<hr/><h2 class="groupheader">Data Structure Documentation</h2>
<a name="structcyhal__timer__cfg__t" id="structcyhal__timer__cfg__t"></a>
<h2 class="memtitle"><span class="permalink"><a href="#structcyhal__timer__cfg__t">&#9670;&nbsp;</a></span>cyhal_timer_cfg_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct cyhal_timer_cfg_t</td>
        </tr>
      </table>
</div><div class="memdoc">
<table class="fieldtable">
<tr><th colspan="3">Data Fields</th></tr>
<tr><td class="fieldtype">
<a id="ae8be9b8ef3b99902c9f2bd29e498d558" name="ae8be9b8ef3b99902c9f2bd29e498d558"></a>bool</td>
<td class="fieldname">
is_continuous</td>
<td class="fielddoc">
Whether the timer is set to continuously run. <p >If true, the timer will run forever. Otherwise, the timer will run once and stop (one shot). Whether the timer/counter operates continuous (true) or one shot (false) </p>
</td></tr>
<tr><td class="fieldtype">
<a id="abcacbb77905a45d92f9ecda65de6fe32" name="abcacbb77905a45d92f9ecda65de6fe32"></a><a class="el" href="group__group__hal__timer.html#gaeb28a1b2d8914e9ad63bb0a68c321ff6">cyhal_timer_direction_t</a></td>
<td class="fieldname">
direction</td>
<td class="fielddoc">
Direction the timer/counter is running. </td></tr>
<tr><td class="fieldtype">
<a id="a795fed3044bc17924b8c73b37019ce99" name="a795fed3044bc17924b8c73b37019ce99"></a>bool</td>
<td class="fieldname">
is_compare</td>
<td class="fielddoc">
Is it in compare (true) or capture (false) mode. </td></tr>
<tr><td class="fieldtype">
<a id="ac94de8306f21c7227250f66e7ac0d775" name="ac94de8306f21c7227250f66e7ac0d775"></a>uint32_t</td>
<td class="fieldname">
period</td>
<td class="fielddoc">
Timer/counter period. </td></tr>
<tr><td class="fieldtype">
<a id="a2fb1a2da36b09c9a1febca770afe3190" name="a2fb1a2da36b09c9a1febca770afe3190"></a>uint32_t</td>
<td class="fieldname">
compare_value</td>
<td class="fielddoc">
Timer/counter comparison value. </td></tr>
<tr><td class="fieldtype">
<a id="a53f34c0bd94d7d4b3661b9bc758d2536" name="a53f34c0bd94d7d4b3661b9bc758d2536"></a>uint32_t</td>
<td class="fieldname">
value</td>
<td class="fielddoc">
Default value of the timer/counter. <a class="el" href="group__group__hal__timer.html#ga86878ca8f781c3ed1a50fbee9e37987f">cyhal_timer_reset()</a> will also change counter to this value when called. </td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a id="gaeb28a1b2d8914e9ad63bb0a68c321ff6" name="gaeb28a1b2d8914e9ad63bb0a68c321ff6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaeb28a1b2d8914e9ad63bb0a68c321ff6">&#9670;&nbsp;</a></span>cyhal_timer_direction_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__group__hal__timer.html#gaeb28a1b2d8914e9ad63bb0a68c321ff6">cyhal_timer_direction_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Timer directions. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="ggaeb28a1b2d8914e9ad63bb0a68c321ff6a1f50f295ead6dbdb36edefc03a183810" name="ggaeb28a1b2d8914e9ad63bb0a68c321ff6a1f50f295ead6dbdb36edefc03a183810"></a>CYHAL_TIMER_DIR_UP&#160;</td><td class="fielddoc"><p >Counts up. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggaeb28a1b2d8914e9ad63bb0a68c321ff6a1595c7343fcdb73d4745f5062d969905" name="ggaeb28a1b2d8914e9ad63bb0a68c321ff6a1595c7343fcdb73d4745f5062d969905"></a>CYHAL_TIMER_DIR_DOWN&#160;</td><td class="fielddoc"><p >Counts down. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggaeb28a1b2d8914e9ad63bb0a68c321ff6af3b8efb5f43123961d8631f74db7ea43" name="ggaeb28a1b2d8914e9ad63bb0a68c321ff6af3b8efb5f43123961d8631f74db7ea43"></a>CYHAL_TIMER_DIR_UP_DOWN&#160;</td><td class="fielddoc"><p >Counts up and down, terminal count occurs on both overflow and underflow. </p>
</td></tr>
</table>

</div>
</div>
<a id="ga39a171d6680fe30685a6e27a333db8e9" name="ga39a171d6680fe30685a6e27a333db8e9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga39a171d6680fe30685a6e27a333db8e9">&#9670;&nbsp;</a></span>cyhal_timer_event_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__group__hal__timer.html#ga39a171d6680fe30685a6e27a333db8e9">cyhal_timer_event_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Timer/counter interrupt triggers. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="gga39a171d6680fe30685a6e27a333db8e9ad9b21c35e61b69c316bee693b8fcb0d6" name="gga39a171d6680fe30685a6e27a333db8e9ad9b21c35e61b69c316bee693b8fcb0d6"></a>CYHAL_TIMER_IRQ_NONE&#160;</td><td class="fielddoc"><p >No interrupt handled. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga39a171d6680fe30685a6e27a333db8e9a51b932b9e3e80d5dd7e98b75e7e8228e" name="gga39a171d6680fe30685a6e27a333db8e9a51b932b9e3e80d5dd7e98b75e7e8228e"></a>CYHAL_TIMER_IRQ_TERMINAL_COUNT&#160;</td><td class="fielddoc"><p >Interrupt when terminal count is reached. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga39a171d6680fe30685a6e27a333db8e9a90cf556247ca96952af696c0a4d53e15" name="gga39a171d6680fe30685a6e27a333db8e9a90cf556247ca96952af696c0a4d53e15"></a>CYHAL_TIMER_IRQ_CAPTURE_COMPARE&#160;</td><td class="fielddoc"><p >Interrupt when Compare/Capture value is reached. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga39a171d6680fe30685a6e27a333db8e9a3b6afa3bcff5af8b040f479eda3aaf35" name="gga39a171d6680fe30685a6e27a333db8e9a3b6afa3bcff5af8b040f479eda3aaf35"></a>CYHAL_TIMER_IRQ_ALL&#160;</td><td class="fielddoc"><p >Interrupt on terminal count and Compare/Capture values. </p>
</td></tr>
</table>

</div>
</div>
<a id="gadb5da20c0e7111025f4091339dd36fc4" name="gadb5da20c0e7111025f4091339dd36fc4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gadb5da20c0e7111025f4091339dd36fc4">&#9670;&nbsp;</a></span>cyhal_timer_input_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__group__hal__timer.html#gadb5da20c0e7111025f4091339dd36fc4">cyhal_timer_input_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Timer/counter input signal. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="ggadb5da20c0e7111025f4091339dd36fc4a39572bdfb86d6dadc6d9d08480590ec3" name="ggadb5da20c0e7111025f4091339dd36fc4a39572bdfb86d6dadc6d9d08480590ec3"></a>CYHAL_TIMER_INPUT_START&#160;</td><td class="fielddoc"><p >Start signal. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggadb5da20c0e7111025f4091339dd36fc4a7d545c6eded78a0ed888498ab4c5fe61" name="ggadb5da20c0e7111025f4091339dd36fc4a7d545c6eded78a0ed888498ab4c5fe61"></a>CYHAL_TIMER_INPUT_STOP&#160;</td><td class="fielddoc"><p >Stop signal. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggadb5da20c0e7111025f4091339dd36fc4ac402b6500fe2fcc1af7438b007cdf3fd" name="ggadb5da20c0e7111025f4091339dd36fc4ac402b6500fe2fcc1af7438b007cdf3fd"></a>CYHAL_TIMER_INPUT_RELOAD&#160;</td><td class="fielddoc"><p >Reload signal. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggadb5da20c0e7111025f4091339dd36fc4a6233db4685faff6dda6280f0cd52eccd" name="ggadb5da20c0e7111025f4091339dd36fc4a6233db4685faff6dda6280f0cd52eccd"></a>CYHAL_TIMER_INPUT_COUNT&#160;</td><td class="fielddoc"><p >Count signal. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggadb5da20c0e7111025f4091339dd36fc4a5ff68c52fe77347327cf5bf47d070ced" name="ggadb5da20c0e7111025f4091339dd36fc4a5ff68c52fe77347327cf5bf47d070ced"></a>CYHAL_TIMER_INPUT_CAPTURE&#160;</td><td class="fielddoc"><p >Capture signal. </p>
</td></tr>
</table>

</div>
</div>
<a id="ga3b82fcbb7e540b55f1923f0cc4c77c30" name="ga3b82fcbb7e540b55f1923f0cc4c77c30"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga3b82fcbb7e540b55f1923f0cc4c77c30">&#9670;&nbsp;</a></span>cyhal_timer_output_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__group__hal__timer.html#ga3b82fcbb7e540b55f1923f0cc4c77c30">cyhal_timer_output_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Timer/counter output signal. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="gga3b82fcbb7e540b55f1923f0cc4c77c30a46034ce48203bb1afe267c91a0f73e6e" name="gga3b82fcbb7e540b55f1923f0cc4c77c30a46034ce48203bb1afe267c91a0f73e6e"></a>CYHAL_TIMER_OUTPUT_OVERFLOW&#160;</td><td class="fielddoc"><p >Overflow signal. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga3b82fcbb7e540b55f1923f0cc4c77c30ad83649c73f9d095d18155c034a228b45" name="gga3b82fcbb7e540b55f1923f0cc4c77c30ad83649c73f9d095d18155c034a228b45"></a>CYHAL_TIMER_OUTPUT_UNDERFLOW&#160;</td><td class="fielddoc"><p >Underflow signal. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga3b82fcbb7e540b55f1923f0cc4c77c30a50d874faf93ea7d2ad764b7f92d9c777" name="gga3b82fcbb7e540b55f1923f0cc4c77c30a50d874faf93ea7d2ad764b7f92d9c777"></a>CYHAL_TIMER_OUTPUT_COMPARE_MATCH&#160;</td><td class="fielddoc"><p >Compare Match signal. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga3b82fcbb7e540b55f1923f0cc4c77c30aa9b363110f2ed6190d1775dbe7f9c673" name="gga3b82fcbb7e540b55f1923f0cc4c77c30aa9b363110f2ed6190d1775dbe7f9c673"></a>CYHAL_TIMER_OUTPUT_TERMINAL_COUNT&#160;</td><td class="fielddoc"><p >Terminal count signal (logical OR of overflow and underflow signal) </p>
</td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="gaa8ca8e199bc9848f8729ff78953bb0fa" name="gaa8ca8e199bc9848f8729ff78953bb0fa"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa8ca8e199bc9848f8729ff78953bb0fa">&#9670;&nbsp;</a></span>cyhal_timer_init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_timer_init </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__timer__t">cyhal_timer_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#ga707195ce0627016bf371643bdd9caa51">cyhal_gpio_t</a>&#160;</td>
          <td class="paramname"><em>pin</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__clock__t">cyhal_clock_t</a> *&#160;</td>
          <td class="paramname"><em>clk</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialize the timer/counter peripheral and configure the pin. </p>
<p ><br  />
 See <a class="el" href="group__group__hal__timer.html#subsection_timer_snippet_1">Snippet 1: Measuring time of an operation</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">obj</td><td>Pointer to a timer/counter object. The caller must allocate the memory for this object but the init function will initialize its contents. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">pin</td><td>optional - The timer/counter compare/capture pin to initialize </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">clk</td><td>optional - The shared clock to use, if not provided a new clock will be allocated and the timer frequency will be set to <a class="el" href="group__group__hal__timer.html#ga28d85cf945883c0e74a533a4ddd7b122">CYHAL_TIMER_DEFAULT_FREQ</a> </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the init request </dd></dl>

</div>
</div>
<a id="ga0ecbd9618bb7cedb7f4b77525e274b09" name="ga0ecbd9618bb7cedb7f4b77525e274b09"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga0ecbd9618bb7cedb7f4b77525e274b09">&#9670;&nbsp;</a></span>cyhal_timer_init_cfg()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_timer_init_cfg </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__timer__t">cyhal_timer_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__timer__configurator__t">cyhal_timer_configurator_t</a> *&#160;</td>
          <td class="paramname"><em>cfg</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialize the Timer peripheral using a configurator generated configuration struct. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">obj</td><td>Pointer to a Timer object. The caller must allocate the memory for this object but the init function will initialize its contents. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">cfg</td><td>Configuration structure generated by a configurator. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the init request </dd></dl>

</div>
</div>
<a id="ga94944664f47b8ff7c093719116b35cdc" name="ga94944664f47b8ff7c093719116b35cdc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga94944664f47b8ff7c093719116b35cdc">&#9670;&nbsp;</a></span>cyhal_timer_free()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cyhal_timer_free </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__timer__t">cyhal_timer_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Deinitialize the timer/counter object. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">obj</td><td>The timer/counter object </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga03e9a7839ffd4e8cad90f97fab176813" name="ga03e9a7839ffd4e8cad90f97fab176813"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga03e9a7839ffd4e8cad90f97fab176813">&#9670;&nbsp;</a></span>cyhal_timer_configure()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_timer_configure </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__timer__t">cyhal_timer_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="group__group__hal__timer.html#structcyhal__timer__cfg__t">cyhal_timer_cfg_t</a> *&#160;</td>
          <td class="paramname"><em>cfg</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Updates the configuration and counter value of the timer/counter object. </p>
<p ><br  />
 This function may temporary stop the timer if it is currently running. See <a class="el" href="group__group__hal__timer.html#subsection_timer_snippet_1">Snippet 1: Measuring time of an operation</a>. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The timer/counter object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">cfg</td><td>The configuration of the timer/counter </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the configure request </dd></dl>

</div>
</div>
<a id="ga38ed4c91e655b8b4f5e446c63327ffe5" name="ga38ed4c91e655b8b4f5e446c63327ffe5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga38ed4c91e655b8b4f5e446c63327ffe5">&#9670;&nbsp;</a></span>cyhal_timer_set_frequency()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_timer_set_frequency </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__timer__t">cyhal_timer_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>hz</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Configures the timer frequency. </p>
<dl class="section note"><dt>Note</dt><dd>This is only valid to call if a null clock divider was provided to <a class="el" href="group__group__hal__timer.html#gaa8ca8e199bc9848f8729ff78953bb0fa">cyhal_timer_init</a>. If a custom clock was provided its frequency should be adjusted directly.</dd></dl>
<p>See <a class="el" href="group__group__hal__timer.html#subsection_timer_snippet_1">Snippet 1: Measuring time of an operation</a>. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The timer/counter object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">hz</td><td>The frequency rate in Hz </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the set_frequency request </dd></dl>

</div>
</div>
<a id="gaff09b3ffee75893da00d0a7dae2d9cb2" name="gaff09b3ffee75893da00d0a7dae2d9cb2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaff09b3ffee75893da00d0a7dae2d9cb2">&#9670;&nbsp;</a></span>cyhal_timer_start()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_timer_start </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__timer__t">cyhal_timer_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Starts the timer/counter with the pre-set configuration from <a class="el" href="group__group__hal__timer.html#ga03e9a7839ffd4e8cad90f97fab176813">cyhal_timer_configure</a>. </p>
<p >This does not reset the counter. The count value will start from the value that was set by the last operation to modify it. See <a class="el" href="group__group__hal__timer.html#ga03e9a7839ffd4e8cad90f97fab176813">cyhal_timer_configure</a>, and <a class="el" href="group__group__hal__timer.html#ga86878ca8f781c3ed1a50fbee9e37987f">cyhal_timer_reset</a> for how the value can be changed. If none of these functions have been called, it will start from 0.<br  />
 See <a class="el" href="group__group__hal__timer.html#subsection_timer_snippet_1">Snippet 1: Measuring time of an operation</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The timer/counter object </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the start request </dd></dl>

</div>
</div>
<a id="ga8734bf8e55f7b51ef18a22e8d1ffb1e1" name="ga8734bf8e55f7b51ef18a22e8d1ffb1e1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga8734bf8e55f7b51ef18a22e8d1ffb1e1">&#9670;&nbsp;</a></span>cyhal_timer_stop()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_timer_stop </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__timer__t">cyhal_timer_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Stops the timer/counter. </p>
<p >Does not reset counter value. <br  />
</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The timer/counter object </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the stop request </dd></dl>

</div>
</div>
<a id="ga86878ca8f781c3ed1a50fbee9e37987f" name="ga86878ca8f781c3ed1a50fbee9e37987f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga86878ca8f781c3ed1a50fbee9e37987f">&#9670;&nbsp;</a></span>cyhal_timer_reset()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_timer_reset </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__timer__t">cyhal_timer_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Reset the timer/counter value to the default value set from <a class="el" href="group__group__hal__timer.html#ga03e9a7839ffd4e8cad90f97fab176813">cyhal_timer_configure</a>. </p>
<p >If <a class="el" href="group__group__hal__timer.html#ga03e9a7839ffd4e8cad90f97fab176813">cyhal_timer_configure</a> was never called, this will reset timer/counter value to 0. This function may temporary stop the timer. <br  />
</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The timer/counter object </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the reset request </dd></dl>

</div>
</div>
<a id="ga0be5bf53c214ffcb3c4e962e71af1e6d" name="ga0be5bf53c214ffcb3c4e962e71af1e6d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga0be5bf53c214ffcb3c4e962e71af1e6d">&#9670;&nbsp;</a></span>cyhal_timer_read()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t cyhal_timer_read </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__timer__t">cyhal_timer_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Reads the current value from the timer/counter <br  />
 See <a class="el" href="group__group__hal__timer.html#subsection_timer_snippet_1">Snippet 1: Measuring time of an operation</a>. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The timer/counter object </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The current value of the timer/counter </dd></dl>

</div>
</div>
<a id="ga928ffe0a3a1549c94752db7c68306424" name="ga928ffe0a3a1549c94752db7c68306424"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga928ffe0a3a1549c94752db7c68306424">&#9670;&nbsp;</a></span>cyhal_timer_register_callback()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cyhal_timer_register_callback </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__timer__t">cyhal_timer_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__timer.html#gae239f85fa523177aeed212846e491206">cyhal_timer_event_callback_t</a>&#160;</td>
          <td class="paramname"><em>callback</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>callback_arg</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Register a timer/counter callback handler<br  />
 </p>
<p >This function will be called when one of the events enabled by <a class="el" href="group__group__hal__timer.html#ga4b97fe48330e9b8034ab7c2f56078002">cyhal_timer_enable_event</a> occurs.</p>
<p >See <a class="el" href="group__group__hal__timer.html#subsection_timer_snippet_2">Snippet 2: Handling an event in a callback function</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The timer/counter object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">callback</td><td>The callback handler which will be invoked when the event occurs </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">callback_arg</td><td>Generic argument that will be provided to the callback when called </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga4b97fe48330e9b8034ab7c2f56078002" name="ga4b97fe48330e9b8034ab7c2f56078002"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga4b97fe48330e9b8034ab7c2f56078002">&#9670;&nbsp;</a></span>cyhal_timer_enable_event()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cyhal_timer_enable_event </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__timer__t">cyhal_timer_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__timer.html#ga39a171d6680fe30685a6e27a333db8e9">cyhal_timer_event_t</a>&#160;</td>
          <td class="paramname"><em>event</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>intr_priority</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>enable</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Configure timer/counter event enablement <br  />
 </p>
<p >When an enabled event occurs, the function specified by <a class="el" href="group__group__hal__timer.html#ga928ffe0a3a1549c94752db7c68306424">cyhal_timer_register_callback</a> will be called.</p>
<p >See <a class="el" href="group__group__hal__timer.html#subsection_timer_snippet_2">Snippet 2: Handling an event in a callback function</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The timer/counter object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">event</td><td>The timer/counter event type </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">intr_priority</td><td>The priority for NVIC interrupt events </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">enable</td><td>True to turn on interrupts, False to turn off </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga5458a719692e938b056150351b287967" name="ga5458a719692e938b056150351b287967"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga5458a719692e938b056150351b287967">&#9670;&nbsp;</a></span>cyhal_timer_connect_digital()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_timer_connect_digital </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__timer__t">cyhal_timer_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__triggers__psoc6__01.html#ga96236d1368f920d28af90262e8b57046">cyhal_source_t</a>&#160;</td>
          <td class="paramname"><em>source</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__timer.html#gadb5da20c0e7111025f4091339dd36fc4">cyhal_timer_input_t</a>&#160;</td>
          <td class="paramname"><em>signal</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Connects a source signal and configures and enables a timer event to be triggered from that signal. </p>
<p >These timer events can be configured independently and connect to the same or different source signals. </p><dl class="section note"><dt>Note</dt><dd>For "edge" signals, this function will default to rising edge. To control the edge type, use <a class="el" href="group__group__hal__timer.html#gaae442666b6e677210fb779f0d4e3a084">cyhal_timer_connect_digital2</a></dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>Timer obj </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">source</td><td>Source signal obtained from another driver's cyhal_&lt;PERIPH&gt;_enable_output </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">signal</td><td>The timer input signal </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The current status of the connection </dd></dl>

</div>
</div>
<a id="gaae442666b6e677210fb779f0d4e3a084" name="gaae442666b6e677210fb779f0d4e3a084"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaae442666b6e677210fb779f0d4e3a084">&#9670;&nbsp;</a></span>cyhal_timer_connect_digital2()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_timer_connect_digital2 </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__timer__t">cyhal_timer_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__triggers__psoc6__01.html#ga96236d1368f920d28af90262e8b57046">cyhal_source_t</a>&#160;</td>
          <td class="paramname"><em>source</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__timer.html#gadb5da20c0e7111025f4091339dd36fc4">cyhal_timer_input_t</a>&#160;</td>
          <td class="paramname"><em>signal</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__general__types.html#ga48a2f3a7a4210f50859fc68fa3db9391">cyhal_edge_type_t</a>&#160;</td>
          <td class="paramname"><em>edge_type</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Connects a source signal and configures and enables a timer event to be triggered from that signal with a configurable edge type. </p>
<p >These timer events can be configured independently and connect to the same or different source signals.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>Timer obj </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">source</td><td>Source signal obtained from another driver's cyhal_&lt;PERIPH&gt;_enable_output </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">signal</td><td>The timer input signal </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">edge_type</td><td>The edge type that should trigger the event. This must be consistent with the edge type of <code>source</code>. If <code>source</code> produces a "level" signal, the only valid value is <a class="el" href="group__group__hal__general__types.html#gga48a2f3a7a4210f50859fc68fa3db9391aa3d90da24e0ba6dff6a0f4c816d1853b">CYHAL_EDGE_TYPE_LEVEL</a>. If <code>source</code> produces an "edge" signal, then <a class="el" href="group__group__hal__general__types.html#gga48a2f3a7a4210f50859fc68fa3db9391aa3d90da24e0ba6dff6a0f4c816d1853b">CYHAL_EDGE_TYPE_LEVEL</a> is not a valid value. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The current status of the connection </dd></dl>

</div>
</div>
<a id="ga0e7450df4a250d811d1ce60cb69285f8" name="ga0e7450df4a250d811d1ce60cb69285f8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga0e7450df4a250d811d1ce60cb69285f8">&#9670;&nbsp;</a></span>cyhal_timer_enable_output()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_timer_enable_output </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__timer__t">cyhal_timer_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__timer.html#ga3b82fcbb7e540b55f1923f0cc4c77c30">cyhal_timer_output_t</a>&#160;</td>
          <td class="paramname"><em>signal</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__triggers__psoc6__01.html#ga96236d1368f920d28af90262e8b57046">cyhal_source_t</a> *&#160;</td>
          <td class="paramname"><em>source</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Enables the specified output signal from a tcpwm that will be triggered when the corresponding event occurs. </p>
<p >Multiple output signals can be configured simultaneously.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>Timer obj </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">signal</td><td>The timer output signal </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">source</td><td>Pointer to user-allocated source signal object which will be initialized by enable_output. <code>source</code> should be passed to (dis)connect_digital functions to (dis)connect the associated endpoints. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The current status of the output enable </dd></dl>

</div>
</div>
<a id="ga4ca94d6326a64dfe56ad6616ee1524a1" name="ga4ca94d6326a64dfe56ad6616ee1524a1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga4ca94d6326a64dfe56ad6616ee1524a1">&#9670;&nbsp;</a></span>cyhal_timer_disconnect_digital()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_timer_disconnect_digital </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__timer__t">cyhal_timer_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__triggers__psoc6__01.html#ga96236d1368f920d28af90262e8b57046">cyhal_source_t</a>&#160;</td>
          <td class="paramname"><em>source</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__timer.html#gadb5da20c0e7111025f4091339dd36fc4">cyhal_timer_input_t</a>&#160;</td>
          <td class="paramname"><em>signal</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Disconnects a source signal and disables the timer event. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>Timer obj </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">source</td><td>Source signal from cyhal_&lt;PERIPH&gt;_enable_output to disable </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">signal</td><td>The timer input signal </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the disconnection </dd></dl>

</div>
</div>
<a id="ga5f81dff94142cbb1e2fa28506bd00491" name="ga5f81dff94142cbb1e2fa28506bd00491"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga5f81dff94142cbb1e2fa28506bd00491">&#9670;&nbsp;</a></span>cyhal_timer_disable_output()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_timer_disable_output </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__timer__t">cyhal_timer_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__timer.html#ga3b82fcbb7e540b55f1923f0cc4c77c30">cyhal_timer_output_t</a>&#160;</td>
          <td class="paramname"><em>signal</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Disables the specified output signal from a timer. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>Timer obj </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">signal</td><td>The timer output signal </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the output disable </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part
<div id="nav-path" class="navpath">
    <ul>
        <li class="footer">
            Generated for <b>Hardware Abstraction Layer (HAL)</b> by <b>Cypress Semiconductor Corporation</b>.
            All rights reserved.
        </li>
    </ul>
</div>
-->
</body>
</html>
